var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(e, g, j) {
    if (im.getServerName().equals("BMS单机") && im.getServerName().equals("BMS至尊体验服") && !im.getServerName().equals("BMS至尊")) {
        im.playerMessage(1, " 使用环境异常，请还原服务端配置。");
        im.dispose();
        return
    }
    if (status == 0 && e == 0) {
        im.dispose();
        return
    }(e == 1) ? status++ : status--;
    selectionLog[status] = j;
    var d = -1;
    if (status <= d++) {
        im.dispose()
    } else {
        if (status === d++) {
            im.dispose();
            var b = im.getNumberFromQuestInfo(64798, "timer") + 10 * 60 * 1000;
            var h = b - new Date().getTime();
            if (h < 10 * 60 * 1000) {
                var c = Math.floor(h / (60 * 1000)),
                    f = Math.floor(h % (60 * 1000) / 1000);
                im.sendOkS_Bottom("还需要#b " + c + "分" + f + "秒 #k才能充电完毕。");
                return
            }
            var a = false;
            for (var d = 0; d < quests.length; d++) {
                if (im.isQuestActive(quests[d]) && im.getNumberFromQuestInfo(quests[d], "chk") < 3 && im.getMap().countMonsterById(mobs[d]) > 0) {
                    im.openCamera(1, 0, [], [mobs[d]], 2, -1, -1, 0);
                    a = true;
                    break
                }
            }
            if (!a) {
                im.playerMessage(5, "这里没有值得拍摄的怪物。")
            }
        }
    }
}
var quests = [65366, 65370, 65373, 65376, 65380];
var mobs = [9601300, 9601301, 9601302, 9601303, 9601304];